<?php
/**
 * php GEM Project
 * 
 * LICENSE
 * 
 * PHP System Architecture Enabling Rapid Application Deployment and Scalability
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * @copyright Copyright (C) 2010 Zeletron LLC (http://zeletron.com)
 * @license http://gem.zeletron.com/license
 */

/*
 * GEM/Model/Domain/HelperFactory.php
 * 
 * 
 * @author David Joly
 * @link http://zeletron.com
 * 
 * @category GEM
 * @package GEM_Model
 * @subpackage GEM_Model_Domain 
 */

class GEM_Model_Domain_HelperFactory
{	
	/**
	 * Returns a GEM_Model_Mapper class corresponding to the
	 * specified class type.
	 * 
	 * @param string $classType
	 * @return GEM_Model_Mapper_Collection
	 * @throws GEM_Model_Domain_Exception
	 */
	public static function getFinder($classType){
		$class = "GEM_Model_Mapper_{$classType}Mapper";
		if(!class_exists($class))
			throw new GEM_Model_Domain_Exception("Mapper class '{$class}' not found.");
		$mapper = new $class;
		return $mapper;
	}
}